﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Otgruzka.ServicesClients;
using BusinessLogic.Statuses;
using BusinessLogic;
using BusinessLogic.Security;

namespace Otgruzka.WebForms
{
    public partial class ConsolidatedAccountList : System.Web.UI.Page
    {
        //protected void Page_PreInit(object sender, EventArgs e)
        //{
        //    string theme = ThemesEnum.BasicBlue;
        //    this.Theme = theme;
        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            BingPromptMessages();
        }

        /// <summary>
        /// Отображение подсказок из БД
        /// </summary>
        private void BingPromptMessages()
        {
            try
            {
                string[] messages = new PromptMessagesClient().GetPromptMessages(this.AppRelativeVirtualPath.Substring(this.AppRelativeVirtualPath.LastIndexOf("/") + 1)).ToArray();

                if (messages != null && messages.Count() > 0)
                {
                    this.PromptMessagesRepeater.DataSource = messages;
                    this.PromptMessagesRepeater.DataBind();
                    this.PromptMessagesRepeater.Visible = true;
                }
                else
                {
                    this.PromptMessagesRepeater.Visible = false;
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
}